package io.bdmc.modules.bss.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.bdmc.common.annotation.Excel;
import io.bdmc.common.annotation.Excels;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 实体
 * </p>
 *
 * @author 黄露
 * @since 2021-06-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
// "DeviceMachineOs对象", description = "")
public class DeviceMachineOs extends Model<DeviceMachineOs> {

  private static final long serialVersionUID = 1L;

  @TableId(value = "machine_os_id", type = IdType.AUTO)
  private Integer machineOsId;

  private Integer deviceId;

  @Excel(name = "设备sn")
  private String diskSn;

  @Excel(name = "通道数")
  private String channelNum;

  @Excel(name = "光源开关状态",readConverterExp = "0=关,1=开")
  private String lightSwitchState;



  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  private LocalDateTime updateTime;

  private Boolean intervalSave;

  @TableField(exist = false)
  @Excels({ @Excel(name = "功率", targetAttr = "lightPower", type = Excel.Type.EXPORT)})
  private List<DeviceMachineOsModule> osModuleList;

  @Excel(name = "创建时间")
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  private LocalDateTime createTime;

  @Override
  public Serializable pkVal() {
    return this.machineOsId;
  }

}
